package top.itpath.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashSet;
import java.util.Set;

/**
 * @author zhaomengru
 * create by  2023/10/10 - 11:17
 * 应用配置
 */
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "itpath")
public class ApplicationProperties {

    /**
     * 默认签名
     */
    private String defaultSign = "33fbl3vtOMDU4BkmoNiuoCBdNWYBCGJt5h";

    /**
     * token过期时间,单位秒
     */
    private Long tokenExpireTime = 3600L;

    private Set<String> ignoreUrls = new HashSet<>() {{
        add("/auth/login");
    }};

    public void setIgnoreUrls(Set<String> ignoreUrls) {
        this.ignoreUrls = ignoreUrls;
        this.ignoreUrls.add("/auth/login");
    }
}
